﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace Office.Spreadsheet.UI
{
    class WorksheetViewModelFactory: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Worksheet ws = (Worksheet) value;
            return ws == null ? null : new WorksheetViewModel(ws);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}